home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / netbsd / tools / warpdate.rexx < prev   
OS/2 REXX Batch file  |  1995-04-30  |  988b  |  52 lines

  1. /* warpdate.rexx */
  2. /* adjust current time so battclock can keep GMT */
  3.  
  4. /* CONFIGURE HERE */
  5. /* number of minutes short of GMT */
  6. off = 300
  7.  
  8. /* STOP CONFIGURING */
  9.  
  10. /* do not change day by default */
  11. changeday = ''
  12.  
  13. /* find minutes after midnight */
  14. mins = time('m')
  15.  
  16. /* adjust minutes */
  17. mins = mins - off
  18.  
  19. /* if we go back a day, adjust minutes and changeday flag */
  20. if mins < 0
  21. then do
  22.     mins = 1440 + mins
  23.     changeday = 'yesterday'
  24. end
  25.  
  26. /* if we go ahead a day, adjust minutes and changeday flag */
  27. if mins > 1439
  28. then do
  29.     mins = 1440 - mins
  30.     changeday = 'tomorrow'
  31. end
  32.  
  33. /* extract new hour from minutes; set minutes to minutes since hour */
  34. hour = trunc(mins / 60)
  35. mins = mins - (hour * 60)
  36.  
  37. /* update seconds */
  38. tmp = time('m')
  39. secs = time('s')
  40. secs = secs - (tmp * 60)
  41.  
  42. /* create an amigados 'date' command */
  43. datestr = 'date 'changeday' 'hour':'mins':'secs
  44.  
  45. /* and change the clock */
  46. address command datestr
  47.  
  48. /* notify of change */
  49. if changeday == ''
  50. then do
  51.     changeday = 'today'
  52.